using BootstrapBlazorApp.Server.LLMs.function;
using System.Globalization;

namespace BootstrapBlazorApp.Server.Utils;
using F23.StringSimilarity;
public class SimilarityUtils
{
    [FunctionDescription("这是一个利用余弦相似度计算文本相似度的函数")]
    public string GetConsineSimilarity([FunctionArg("标准回答")]string str1, 
                                        [FunctionArg("用户回答")]string str2)
    {
        Cosine cosine = new Cosine();
        return cosine.Similarity(str1, str2).ToString(CultureInfo.CurrentCulture);
    }
}
